home *** CD-ROM | disk | FTP | other *** search
/ Sun Solutions 1997 April to September / Sun Solutions CD - APR '97 - SEP '97 (704-3778-12 Rev. H)(Sun Microsystems, Inc.)(1997).iso / products / Pocketsoft / _install / install next >
Text File  |  1996-05-29  |  3KB  |  141 lines

  1. #! /bin/sh  
  2. #
  3. #    Installation shell script for Catalyst CDware
  4. #
  5. #       Usage: install -m<mountpoint> -p<productpath>
  6. #
  7. #    Created:     June 12, 1991
  8. #       Last Revised:   May 28, 1996
  9. #                 
  10. #    Use this installation script to install your product from Catalyst CDware
  11. #
  12. #
  13. #    For technical support, please call.
  14. #        +1 415 336.3742 (CDware SPARC) or +1 415 336.3941 (CDware x86)
  15. #
  16. #    get command line parameters
  17. #
  18.  
  19. # function for error exiting
  20.  
  21. end_it () {
  22. echo " "
  23.   echo "Hit return to end ... "
  24.   read answer
  25.  
  26. exit 0
  27. }
  28.  
  29.  
  30. #    set PRODUCT_SIZE to the size of your product in kbytes     
  31.  
  32. PRODUCT_SIZE=284
  33.  
  34. #
  35. #    get complete paths
  36. #
  37. #
  38. #    get location of installation directory 
  39. ##
  40. echo
  41. echo "Please enter the absolute path name of the directory structure in which"
  42. echo "you would like to install the .RTPatch(R) evaluation programs."
  43. echo
  44. echo "Installation directory: "
  45. read INSTALL_DIR
  46.  
  47. #
  48. #    verify the installation directory exists and is a directory
  49. #
  50. if [ ! -d "$INSTALL_DIR" ]
  51. then
  52.     echo "Creating $INSTALL_DIR ..."
  53.     mkdir $INSTALL_DIR
  54.     if [ ! -d "$INSTALL_DIR" ]
  55.     then
  56.         echo
  57.         echo
  58.         echo "Could not create the installation directory."
  59.         echo
  60.         echo "Exiting the installation script."
  61.                 end_it
  62.     fi
  63. fi
  64.  
  65. #
  66. #    verify write permission for the installation directory
  67. #
  68. if [ ! -w "$INSTALL_DIR" ]
  69. then
  70.     echo
  71.     echo
  72.     echo "You do not have write permission for the installation directory: "
  73.     echo $INSTALL_DIR
  74.     echo
  75.         echo
  76.     echo "Exiting the installation script."
  77.         end_it
  78. fi
  79.  
  80. #
  81. #    verify free disk space
  82. #
  83. echo    
  84. echo    "Verifying free disk space..."
  85. FREE_SPACE=0
  86. df=/tmp/FREE.$$
  87. #
  88. # WARNING:
  89. # --------
  90. # For Solaris 2.4, the df line below will need to be updated because
  91. # the standard output of the df command has changed in Solaris 2.4
  92. #
  93. /usr/bin/df -k $INSTALL_DIR | sed /kbytes/d | sed -e '3,$d' | sed -e '1,$s/  */ /g' > $df
  94.  
  95. case `/usr/bin/wc -l $df | sed -e 's/^ *//' | cut -f1 -d" " ` in
  96.     1) FREE_SPACE=`cat $df | cut -f4 -d" "` ;; 
  97.     2) FREE_SPACE=`cat $df | sed 1d | sed 's/^ *//' | cut -f3 -d" "` ;; 
  98. esac
  99.  
  100. if [ -n $FREE_SPACE ]
  101. then
  102.     if [ $FREE_SPACE -lt $PRODUCT_SIZE ]
  103.     then
  104.         echo
  105.         echo
  106.         echo "The product installation requires $PRODUCT_SIZE kbytes of"
  107.         echo "free disk space. There is only $FREE_SPACE kbytes of free" 
  108.         echo "disk space in the selected filesystem.  Please free up some"
  109.         echo "disk space and try this installation again."
  110.         echo
  111.         echo "Exiting the installation script."
  112.             end_it     
  113.     fi
  114. fi
  115. /bin/rm $df 2>/dev/null
  116.  
  117. #
  118. #    copy binaries to installation directory
  119. #
  120. echo 
  121. echo "Copying files to "$INSTALL_DIR"..."
  122. echo
  123. #
  124. # uncomment the following line to do the actual copy
  125. #
  126.  
  127. cd $INSTALL_DIR
  128.  
  129. cp $COMPANY_DIR/_install/rtpatch.Z $INSTALL_DIR
  130.  
  131. echo
  132. echo "The installation completed..."
  133. echo
  134. echo "To extract RTPatch, do the following:"
  135. echo
  136. echo "1. Change directories to "$INSTALL_DIR""
  137. echo "2. Run the following command: uncompress rtpatch.Z"
  138. echo "3. Untar the file AccordSTAR by doing: tar xvf rtpatch"
  139.  
  140. end_it
  141.